<?php
@header("Content-type:text/html;charset=GB2312");
defined('BASEPATH') OR exit('No direct script access allowed');

class Tag extends CI_Controller
{
    function index(){
        $my = $this->load->database('default', TRUE);
        $ms = $this->load->database('sqlserver', TRUE);

        $size = 1;
        $page = isset($_GET['page']) ? $_GET['page'] : 0;
        $zongshu = $page + $size;

        $sql = "select top $size * from (select top $zongshu  * from fy_TAGS order by Id asc) fy_TAGS order by Id desc";
        $msq = $ms->query($sql)->result_array();
        foreach($msq as $i => $v){
                //$m[$i]['KID'] = $v['Id'];
                $m[$i]['subtitle'] = $v['TagName'];
                $m[$i]['SoftId'] = $v['SoftId'];
                $m[$i]['TagNumbers'] = $v['TagNumbers'];
            $mm[$i]['subtitle'] = $v['TagName'];
            $my->where('id', $m[$i]['SoftId'])->update('phpcms_download', $mm[$i]);
            $my->affected_rows();
        }
        /*$my->where('id', '1');
        $my->update('sites', $data);
        $my->set();*/
        var_dump("<pre>");
        var_dump($m);
    }
}